package com.wwj.pojo;


import lombok.Data;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.Email;

@Component
@Data
@ConfigurationProperties(prefix = "emp")
@Validated  //数据校验
public class Emp {

    private String lastName;
    private Integer age;
    private String sex;

    @Email(message="邮箱格式错误")
    private String email;

}


